#!/usr/bin/env python
# -*- coding:utf-8 -*-

# file:__init__.py.py
# author:Jackiex
# datetime:2023/5/18 15:22
# software: PyCharm

"""
this is function  description 
"""

from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker

from config import config  #当前文件夹进导入配置文件

# 创建引擎

# engine = create_engine("mysql+pymysql://test:123456@127.0.0.1:3306/sct_study",  encoding="UTF-8")

engine = create_engine(config.SQLALCHEMY_DATABASE_URI,
                       pool_size=config.POOL_SIZE,
                       max_overflow=config.MAX_OVERFLOW
                       )

# 创建会话对象
Session = sessionmaker(bind=engine)

# 创建会话实例
session = Session()
